#include <iostream>
#include <algorithm>
#define INF 0x3f3f3f3f

using namespace std;
const int N = 1e5 + 5;
int arr[N], n, m, k;
bool check(int t) {
	int d = k - 1, M = m, b = 1;
	for (int i = 2; i <= n;) {
		while (d == 0 && M > 0 && i <= n) d = k - 1, M --, b = i ++;
		
		if (b >= n && M > 0) return true;
		
		if (arr[i] - arr[b] <= t) i ++, d --;
		
		else b = i ++, d = k - 1, M --;
		
		if (M <= 0) return false;
	}
	return true;
}

signed main() {
	ios::sync_with_stdio(false);
	cin >> n >> m >> k;
	for (int i = 1; i <= n; ++ i)
		cin >> arr[i];
	sort(arr + 1, arr + 1 + n);
	int l = 0, r = INF, mid, ans;
	for (int i = 2; i <= n; ++ i) r = max(r, arr[i] - arr[i - 1]);
	ans = r;
	while (l <= r) {
		mid = l + r >> 1;
		if (check(mid)) r = mid - 1, ans = min(mid, ans);
		else l = mid + 1;
	}
	cout << ans;
	return 0;
}
